<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue的修饰符</title>
		<script src="../vue@3.2.23.js"></script>
	</head>
	<body>
		<div calss="app" >
			<form action="" v-for="val in fromData">
				<input v-if="val.type == text" :type="val.type" :name="val.name" :placeholder="val.placeholder" v-model.lazy="name"/>
				<input type="text" v-model.lazy="name"/>
				<textarea v-else-if="val.type == textarea" :type="val.type" :name="val.name" :placeholder="val.placeholder" v-model="val.value" rows="10" cols="20"></textarea>
			</form>
		</div>
	</body>
</html>
<script>
	const {createApp} = Vue;
	const app = createApp({
		data(){
			// formData:[
			// 	{
			// 		type:"text",
			// 		name:"phoneName",
			// 		placeholder:"请输入号码",
			// 		value:""
			// 	},
			// 	{
			// 		type:"textarea",
			// 		name:"name",
			// 		placeholder:"请输入昵称",
			// 		value:""
			// 	},
				
			// ],
			return{
				name:'',
				num:1
			}
			
		},
		methods:{
			
		},
		watch:{
			name(){
				console.log(数据改变了)
			},
			num(newNum){
				console.log(newNum)
			}
		}
	})
	const vm = app.mount('#app')
</script>